package chapter15.exercise;

public class BaseGeneratorDemo implements Cloneable {
    public BaseGeneratorDemo clone() {
        try {
            return (BaseGeneratorDemo) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException();
        }
    }

    public static void main(String[] args) {
        BaseGenerator<CountObject> gen = BaseGenerator.create(CountObject.class);
        for (int i = 0; i < 5; i++) {
            System.out.println(gen.next());
        }
        BaseGeneratorDemo demo = new BaseGeneratorDemo();
        System.err.println(demo);
        System.err.println(demo.clone());
    }
}
